package com.geek.water.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author yangwenqi
 * @decs TODO
 * @date 2025/7/25
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("device")
@ApiModel(description = "设备档案表")
public class Device implements Serializable {
    @ApiModelProperty("主键，自增设备ID")
    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("关联区域ID")
    @TableField("area_id")
    private Long areaId;

    @ApiModelProperty("设备型号")
    @TableField("model")
    private String model;

    @ApiModelProperty("设备出厂序列号")
    @TableField("serial_no")
    private String serialNo;

    @ApiModelProperty("在线状态")
    @TableField("status")
    private String status;

    @ApiModelProperty("最后心跳时间")
    @TableField("last_heartbeat")
    private LocalDateTime lastHeartbeat;

    @ApiModelProperty("创建时间")
    @TableField(value = "created_at",fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @ApiModelProperty("当前水量(吨)")
    @TableField("current_reading")
    private BigDecimal currentReading;

    @ApiModelProperty("设备监控数据")
    @TableField(exist = false)
    private List<DeviceData> deviceDataList;
}